#include "Callback/Call.h"

int main()
{
    std::cout << "start program "<< endl;

    // 传递者
    // unique_ptr<Callee> m_calleePtr(new Callee);
    
    // 调用者
    // unique_ptr<Caller> m_callerPtr(new Caller);
    // unique_ptr<Caller1> m_callerPtr1(new Caller1);

    // m_callerPtr->setCallBack(std::bind(&Callee::func, m_calleePtr.get(), std::placeholders::_1));
    // m_callerPtr1->setCallBack(std::bind(&Callee::func1, m_calleePtr.get(), std::placeholders::_1));

    // setCallback_f(std::bind(&Callee::func, m_calleePtr.get(), std::placeholders::_1));
    // setCallback_ff(std::bind(&Callee::func1, m_calleePtr.get(), std::placeholders::_1));

    // 类静态成员变量进行调用
    //Caller::setCallBack(std::bind(&Callee::func, m_calleePtr.get(), std::placeholders::_1));
    //Caller1::setCallBack(std::bind(&Callee::func1, m_calleePtr.get(), std::placeholders::_1));

    printf("\n");

    // 普通函数作为回调
    functionA();
    callback(functionB);
    printf("\n");

    // 类的静态函数最为回调
    ProgramA pa;
    ProgramB pb;
    pb.setCallback(ProgramA::func_pa, "123");

    // getchar();

    // 退出
    // m_callerPtr->setExit(true);
    // m_callerPtr1->setExit(true);

    std::cout << "\nFinish" << endl;    
    return 0;
}
